package testing;

import mobile.*;
import java.io.*;
import item.*;
import core.*;



public class RqTest
{

	public static void main(String[] args) 
	{
		Mobile a = new Mobile(10,"Slacker","alien");
		System.out.println("Race: " + a.getRace());
		a.setName("gunnar");
		System.out.println("Name: " +  a.getName());
		System.out.println("Hp: " + a.getHp());
		int dmg=a.hitMe(5);
		System.out.println("Try to hit for 5, did hit for " + dmg);
		System.out.println("Hp: " + a.getHp());
		dmg=a.hitMe(10);
		System.out.println("Try to hit for 10, did hit for " + dmg);
		System.out.println("Hp: " + a.getHp());
		System.out.println("****\n\n");
		char c='g';
		Mobile player = new Mobile ("Elf");
		do
		{
			player.generateStats("Elf");
			System.out.println(player.getStats());
			System.out.println("Hp: " + player.getHp());
			System.out.println("Re roll? (Y/n)");
			try { 
				int tmp = System.in.read (); 
				c = (char) tmp;
			}
			catch (IOException e) {}

		} while (  c != 'n' );

		/* inventory
		 * wield and get bonuses test
		 */
		player.printInventory();
		System.out.println(player.getCombatStatus());
		System.out.println("equipping yxa");
		Item yxa = new Item("yxa",1,1,1);
		yxa.setAttackBonus(2);
		yxa.setIType(1);
		player.getItem(yxa);
		player.equip(0);
		yxa.printStatus();
		player.printInventory();
		System.out.println(player.getCombatStatus());
		System.out.println("unequipping yxa");
		player.unEquip(0);
		player.printInventory();
		System.out.println(player.getCombatStatus());
		 
		/*
		int i=0;
		while( player.getItem(new Item("item " + i ,1,1,1)) == 0)
			i++;
		 */
		/*
		 *	Equp test
		player.printInventory();
//		System.out.println("i=" +i);
		System.out.println("***********");
		player.equip(2);
		player.printInventory();
		System.out.println("***********");
		player.equip(3);
		player.printInventory();

		 */
		/* 
		 * Level up test
		 */
		//player.setClass("Wizard");
		/*
	System.out.println("XP: " + player.getXp() );
	System.out.println("Level: " + player.getLevel() ) ;
	System.out.println("Hp: " + player.getHp());
	System.out.println("Mp: " + player.getMana());
	for (int i = 0; i < 4; i++)
	{
		while (player.levelUp() != 1 )
		{
			player.addXp(1);
		}

			System.out.println("\nDing Level" + player.getLevel() ); 
			System.out.println("XP: " + player.getXp() );
			System.out.println("Hp: " + player.getHp());
			System.out.println("Mp: " + player.getMana());
	}
	System.out.println(player.getStats());
		 */
		Mobile player2 = new Mobile ("Elf");
		Mobile player3 = new Mobile ("Elf");
		Mobile player4 = new Mobile ("Elf");
		Mobile player5 = new Mobile ("Elf");
		Mobile player6 = new Mobile ("Elf");
		player.setName("kalle");
		player2.setName("pelle");
		player3.setName("olle");
		player4.setName("nisse");
		player5.setName("fjompas");
		player6.setName("skrutt");

		Combat COMBAT = new Combat();
		COMBAT.addPlayer(player);
		COMBAT.printParty();
		System.out.println("********");
		COMBAT.addPlayer(player2);
		COMBAT.addPlayer(player3);
		COMBAT.addPlayer(player4);
		COMBAT.addPlayer(player5);
		COMBAT.addPlayer(player6);
		COMBAT.printParty();	
		System.out.println("Remove nisse ********");
		COMBAT.removePlayer(3);
		COMBAT.printParty();	
		System.out.println("move 2 to 3");
		COMBAT.movePlayer(2, 3);
		COMBAT.printParty();
		System.out.println("move 5 to 6");
		COMBAT.printParty();


	} // End main
}
